package vn.bang.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name="player")
public class PlayerDTO implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
	@LazyCollection(LazyCollectionOption.EXTRA)
	@JoinColumn(name = "board_id")
	private BoardDTO board;
	@Column(name="score")
	private int score;
	
	public Long getId() {
		return id;
	}
	public BoardDTO getBoard() {
		return board;
	}
	public int getScore() {
		return score;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setBoard(BoardDTO board) {
		this.board = board;
	}
	public void setScore(int score) {
		this.score = score;
	}
}
